#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (c) 2025 粤港澳大湾区（广东）国创中心

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

File: pyncti_add_assembly.py
Desc: Function to add an assembly to the current document.
Author: xumanjia
Date: 2025-08-01
"""

def pyncti_add_assembly(NCTI,doc):
    doc.ResetCaseResult()
    res  = doc.ReturnDialogData(-1, "添加装配文档","对象名称","assemble", "显示名称", "装配")
    if len(res) > 0:
        doc.AddAssemble(res[0], res[1])
        doc.SetCreateGeGeom(1)  # 不生成平台对象（不生成会快）
        doc.Zoom()